//
//  SwitchCell.m
//  PlayBall
//
//  Created by Jdd‘s macbook on 13-11-12.
//
//

#import "JddSwitchCell.h"

@implementation JddSwitchCell
GET_INSTANCE_VIEW_IMPLEMENT(JddSwitchCell)

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (IBAction)setSwitchSelected:(id)sender{
    UISwitch *s = (UISwitch *)sender;
    NSString *keyName;
    switch (self.row) {
        case 0:
            keyName = @"jq";
            break;
        case 1:
            keyName = @"hhp";
            break;
        default:
            break;
    }
    [USER_DEFAULT setBool:!s.on forKey:keyName];
    [USER_DEFAULT synchronize];}

@end
